/*
 *  Squirrel.cpp
 *  SquirrelAdven
 *
 *  Created by James Weaver on 3/11/11.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */

#include "Squirrel.h"
#include "OBJtoTriMesh.h"
#include <iostream>

// constructor
Squirrel::Squirrel() {
	characterID = -1;
	characterMesh = NULL;
	//	dialogTree = NULL;
	inventory = NULL;// new Object(); // Inventory consists of 1 item. Squirrels are small! (this can be changed)
	direction = 0;
}

// destructor
Squirrel::~Squirrel() {
}

// get TriMesh of the Squirrel
TriMesh * Squirrel::getCharacterMesh() {
	OBJtoTriMesh meshLoader;
	printf("gothere\n");
	std::string path = "./";
	std::string objfilename = "fakePlayer.obj";
	std::string wmtffilename = "squirrel.wmtf";
	characterMesh = meshLoader.CreateMesh(path,objfilename, wmtffilename);
	printf("gothere2\n");
	
	return characterMesh;
}

// get DialogTree
//DialogTree * Squirrel::getDialogTree() {
//	return dialogTree;
//}

void Squirrel::addToInventory(Object * obj)
{
	inventory = obj;
}

void Squirrel::removeFromInventory(Object * obj)
{
	if (inventory == obj)
	{
		inventory = NULL;
	}
	else
	{
		// item not in inventory
	}
}

void Squirrel::setCharacterID(int ID) {
	characterID = ID;
}
void Squirrel::setCharacterTitle(std::string title) {
	characterTitle = title;
}

void Squirrel::setCharacterName(std::string name) {
	characterName = name;
}

void Squirrel::setCharacterSpecies(std::string species) {
	characterSpecies = species;
}

void Squirrel::setCharacterBackground(std::string background) {
	characterBackground = background;
}

void Squirrel::setObjFilename(std::string objFilename) {
	this->objFilename = objFilename;
}

//void Squirrel::setDialogFilename(std::string dialogFilename) {
//	this->dialogFilename = dialogFilename;
//	dialogTree = new DialogTree(dialogFilename);
//}

int Squirrel::getCharacterID() {
	return characterID;
}

std::string Squirrel::getCharacterTitle() {
	return characterTitle;
}


std::string Squirrel::getCharacterName() {
	return characterName;
}

std::string Squirrel::getCharacterSpecies() {
	return characterSpecies;
}

std::string Squirrel::getCharacterBackground() {
	return characterBackground;
}

void Squirrel::printData() {
	std::cout << "ID: " << characterID << "\n";
	std::cout << "Title: " << characterTitle << "\n";
	std::cout << "Name: " << characterName << "\n";
	std::cout << "Species: " << characterSpecies << "\n";
	std::cout << "Background: " << characterBackground << "\n";
	std::cout << "ObjFilename: " << objFilename << "\n";
	std::cout << "DialogFilename: " << dialogFilename << "\n";
	std::cout << "DialogTree:\n";
	//	dialogTree->printData();
}